|
|
|
|
|
|
|
Figure 25.7
Select the DataField property for the bound control
from the list of fields in the selected Data control. |
|
|
|
|
| |
|
|
|
|
Instead of dropping down the list, double-click the DataField property to scroll through the available fields. |
|
|
|
|
|
|
CAUTION
|
|
|
|
|
You cannot select a field for the DataField property from a list until the DataSource property has been set. |
|
|
|
|
|
|
|
|
|
|
Creating a Simple Application |
|
|
|
|
|
|
|
|
Earlier in this chapter, you began a simple test application that will allow you to browse and modify the names of authors stored in the sample BIBLIO database. Continue with that example now. |
|
|
|
|
|
|
|
|
You should have already set up a Data control that is bound to the BIBLIO database through its DatabaseName property. You are now ready to set the Data control's RecordSource property. From the Property window's selection list, select the Authors table. The Data control is now ready for use. |
|
|
|
|
|
|
|
|
The next step in creating the data access form is to add the bound controls. To make the example easy, just use text boxes for each of the fields. Also, for each field, place a normal unbound Label control on the form to identify the information in the text box. For the sample case, you need three text boxes and three corresponding labels. Set the DataSource property of all the text boxes to dtaMain, which is the name of the Data control you have already created. For each text box, you also need to specify a DataField property. Remember that the DataField property ties the control to a specific field in the database. Table 25.2 lists the |
|
|
|
|
|